package com.itheima.demo03functionalinterface;

import java.util.function.Consumer;

public class Demo03Consumer {

    //使用Lambda表达式将一个字符串先转成小写再转成大写
    public static void main(String[] args) {
        System.out.println("开始啦");
        printHello(str -> System.out.println(str.toLowerCase()), str -> System.out.println(str.toUpperCase()));
    }

    public static void printHello(Consumer<String> c1, Consumer<String> c2) {
        System.out.println("aaa");
        String str = "Hello World";
//        c1.accept(str);
//        c2.accept(str);
        c1.andThen(c2).accept(str);
    }
}
